/*
 * @Author: your name
 * @Date: 2021-01-16 15:54:38
 * @LastEditTime: 2021-01-17 20:31:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \egg-RESTfulAPI\app\model\baseSegmentAndPointModel.js
 */

module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema

    const BaseSegmentModelSchema = new mongoose.Schema({
        road_Id: { type: Number, unique: false },
        Id_1: { type: Number, unique: false },
        Id_2: { type: Number, unique: false },
        geometry: { type: [], unique: false, index: 'text' },
        road_type: { type: Number, unique: false },

        manager: { type: Schema.Types.ObjectId, ref: 'BaseSegmentAndPointManagerModel' },
    }, { timestamps: { createdAt: 'created', updatedAt: 'updated' }, usePushEach: true })

    return mongoose.model('BaseSegmentModel', BaseSegmentModelSchema)

}